﻿//********************************************************************************//
//创建日期：<创建日期，2016-03-16>
//创建作者：<郭登杰，guodengjie@shanghai3h.com>
//功能说明：公共DAL
//********************************************************************************//
using System;
using System.Collections.Generic;
using YXYLCommon;
using System.Data;

namespace Entity
{
    
    public class DALCommon : BaseDAL
    {
        public DALCommon()
        {

        }
        protected override void fillSaveProc(BaseModel model)
        {
            
        }

        public List<DDLItem> GetDDLItemList(string tableName, string textName, string valueName, string splitChar, string condition, string orderColumn)
        {
            dbProc.Init("P_COMMON_GETTEXTANDVALUE");
            dbProc.AddParameter("V_FIND_TABLE_NAME", tableName);
            dbProc.AddParameter("V_TEXT_COLUMN_NAME", textName);
            dbProc.AddParameter("V_VALUE_COLUMN_NAME", valueName);
            dbProc.AddParameter("SPLITCHAR", splitChar);
            dbProc.AddParameter("CONDITION", condition);
            dbProc.AddParameter("V_ORDERCOLUMN", orderColumn);
            return CommonService.Ini().GetList<DDLItem>(dbProc);
        }
        public List<DDLItem> GetDDLItemList(string tableName, string textName, string valueName,string parentName, string splitChar, string condition, string orderColumn)
        {
            dbProc.Init("P_COMMON_GETTEXTANDVALUE2");
            dbProc.AddParameter("V_FIND_TABLE_NAME", tableName);
            dbProc.AddParameter("V_TEXT_COLUMN_NAME", textName);
            dbProc.AddParameter("V_VALUE_COLUMN_NAME", valueName);
            dbProc.AddParameter("V_PARENT_COLUMN", parentName);
            dbProc.AddParameter("SPLITCHAR", splitChar);
            dbProc.AddParameter("CONDITION", condition);
            dbProc.AddParameter("V_ORDERCOLUMN", orderColumn);
            return CommonService.Ini().GetList<DDLItem>(dbProc);
        }
    }

}